<?php
class Contact
{
	public function __construct()
	{
		
	}
	
	public function index()
	{
		
	}
	
	public function sendMail()
	{
		$request = CommonFunc::getRequest();
		$name = $request['name'];
		$email = $request['email'];
		$message = $request['message'];
		$msgbody = "";
		
		$subject = "Inquiry from " . $name;
		
		$msgbody .= "Dear Admin,\n\n";
		$msgbody .= "You have an inquiry from " . $name . "\n\n";
		$msgbody .= "----------------------------------------------\n\n";
		$msgbody .= "Name: " . $name . "\n\n" . "Email: " . $email . "\n\n" . "Message :" . $message . "\n\n";
		$msgbody .= "----------------------------------------------\n\n";
		$msgbody .= "This is an auto generated email. Please do not reply";
		
		$from = "info@officesupplies.lk";
		
		if(mail(ADMIN_EMAIL, $subject, $msgbody, $from))
		{
			echo "<span class='success'>Your message has been successfully sent. One of our staff member will contact you soon. Thankyou for choosing " . SITENAME . "</span>";
		}
	}
}	
?>